<template>
  <view class="content ba_img" :style="{ 'background-image': backImg }">
    <view
      class="head"
      :style="{
        top: statusBarHeight + 'px',
      }"
    >
      <view class="head_left">
        <u-icon
          name="arrow-left"
          color="#444"
          size="24"
          :bold="true"
          @click="toBack"
        ></u-icon>
      </view>
      <view class="text">成长记录</view>
    </view>

    <floatingBall></floatingBall>
  </view>
</template>

<script>
import config from "@/config"; // 配置文件
export default {
  data() {
    return {
      statusBarHeight: 0,
      backImg: ``,
    };
  },
  created() {
    const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度
    this.statusBarHeight = statusBarHeight.statusBarHeight;
    this.getLevel();
  },
  methods: {
    toBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
    getLevel() {
      this.$http
        .userLevelInfo({})
        .then((res) => {
          this.backImg = `url("${config.uni_app_web_api_url}/vip/${
            res.data.data.level_id + "_" + res.data.data.time
          }.png")`;
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
  },
};
</script>

<style scoped lang="scss">
.ba_img {
  margin: 0;
  // background: url("/static/images/6b0fffb19fbb13adebeb4aeea6d7c6f-.png") no-repeat;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
  box-sizing: border-box;
}
.head {
  width: 100%;
  padding: 18rpx 30rpx 47rpx;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 99;

  .head_left {
    position: absolute;
    left: 30rpx;
  }

  .text {
    font-size: 36rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: 400;
    color: #444;
  }
}
</style>